package com.newer.dao.sys.mapper;

import com.newer.pojo.sys.User;
import com.newer.pojo.sys.UserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository("userMapper")
public interface UserMapper {
    int countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Integer id);
    
    int deleteByIds(List<String> ids);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExample(UserExample example);

    User selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);
    
    @Select("select * from tb_user where user_name=#{userName}")
    User selectByName(String userName);
    
    @Select("select * from tb_user where telephone=#{telephone}")
    User selectByTelephone(String telephone);
    
    @Update("update tb_user set password=#{newPassword} where id=#{id} and password=#{password}")
    int updatePassword(String password,String newPassword,Integer id);
    
}